<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<button onclick="handleClick({
func:'java[\'showStage\']',
param:null
})">开启投屏窗口
</button>
<button onclick="handleClick({
func:'java[\'closeStage\']',
param:null
})">关闭投屏窗口
</button>
<button onclick="handleClick({
func:'addBtn',
param:null
})">投屏窗口增加一个按钮
</button>
</body>
<script>
    var java = ""

    function handleClick(msg) {
        if (java) {
            console.log("msg  ", msg)
            java.sendMsg(JSON.stringify(msg))
        } else {
            alert("没有java变量")
        }
    }

</script>
</html>